package com.xzw.utils;

import java.sql.Connection;
import java.sql.SQLException;

import com.mchange.v2.c3p0.ComboPooledDataSource;

public class JdbcUtils
{ 
	private static ComboPooledDataSource ds =null;
	
	static{
		ds =new ComboPooledDataSource("db_novelweb");
	}

	public static ComboPooledDataSource getDataSource() {
		
		return ds;
	}
	public static Connection getConnection()
	{
		Connection conn;
		try {
			conn = ds.getConnection();
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
		return conn;
	}

}
